import iHyperDBSDK
import sys
import time
from datetime import date
from iHyperDBSDK import server

if __name__ == '__main__':
    ip="192.168.224.3"
    myServer=server.Server(ip,5673,'',5673)
    myServer.connect()
    myServer.login("admin","admin")
    tagManager=myServer.tag_mgr
    condition=['tagname','like',b"*"]
    tags=tagManager.query_tags_cond([condition])
    tag=tags.get_next()
    while(tag!=None):
        #print(str(tag.tagname)+"   "+str(tag.descriptor))
        tagname=str(tag.tagname, 'gbk');
        if tagname.__contains__("@2CC"):
            try:
                print(str(tag.descriptor,'utf-8')+","+str(tag.tagname,'utf-8')+",2CC,,IPLAT4J,S_DA_CC_11")
            except Exception as e:
                print(str(tag.descriptor, 'gbk') + "," + str(tag.tagname, 'gbk') + ",2CC,,IPLAT4J,S_DA_CC_11")
        tag = tags.get_next()